package user

import (
	"goZero/easy-chat/apps/im/ws/internal/svc"
	websockettx "goZero/easy-chat/apps/im/ws/websocket"
)

func OnLine(svc *svc.ServiceContext) websockettx.HandlerFunc {
	return func(srv *websockettx.Server, conn *websockettx.Conn, msg *websockettx.Message) {
		uids := srv.GetUsers()
		u := srv.GetUsers(conn)
		err := srv.Send(websockettx.NewMessage(u[0], uids), conn)
		srv.Info("err", err)
	}
}
